<?php

class Controller extends controllerBase {

	public function index($id = 0)
	{
		if($id > 0 )
		{
			echo '<h2>' . $event->title . '</h2>
					  <p>Date: ' . format::date($event->data['date']) . '</p>
					  <p>Location: ' . $event->location . '</p>
					  <p>' . $event->description . '</p>';
		}
		else
		{
			echo '<h2>Upcoming Events</h2>';
			echo event_module::upcoming();
			echo '<h2>Recent Events</h2>';
			echo event_module::recent();
			echo '<h2>Events Archive</h2>';
			echo event_module::archiveYears();
		}
	}
	
	public function archive($year = 0)
	{
		if($year > 0)
		{
			echo event_module::displayYear($year);
		}
		else
		{
			self::index();
		}
	}
}
?>